package net.hands.ado.db.jdbc;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Statement;

import net.hands.ado.db.SQLValue;

/**
 * 这是一个开源的软件，请在LGPLv3下合法使用、修改或重新发布。
 * 
 * @author 陈侃(cknet@126.com, 13910090885)
 *         http://code.google.com/p/simpleframework/
 *         http://www.simpleframework.net
 */
public interface IStatementCreator {

	/**
	 * 创建PreparedStatement对象
	 * 
	 * @param connection
	 * @param sqlVal
	 * @param resultSetType
	 * @param resultSetConcurrency
	 * @return
	 * @throws SQLException
	 */
	PreparedStatement prepareStatement(Connection connection, SQLValue sqlVal, int resultSetType,
			int resultSetConcurrency) throws SQLException;

	PreparedStatement prepareStatement(Connection connection, SQLValue sqlVal) throws SQLException;

	/**
	 * 
	 * @param connection
	 * @param sql
	 * @return
	 * @throws SQLException
	 */
	PreparedStatement prepareStatement(Connection connection, String sql) throws SQLException;

	/**
	 * 
	 * @return
	 * @throws SQLException
	 */
	Statement createStatement(Connection connection) throws SQLException;
}
